<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="实训day_01, LowYeah">
    <meta name="description" content="实训day_01">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="referrer" content="no-referrer-when-downgrade">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>实训day_01 | LowYeah</title>
    <link rel="icon" type="image/png" href="/favicon.png">
    


    <!-- bg-cover style     -->



<link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.min.css">
<link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
<link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
<link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
<link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
<link rel="stylesheet" type="text/css" href="/css/matery.css">
<link rel="stylesheet" type="text/css" href="/css/my.css">
<link rel="stylesheet" type="text/css" href="/css/dark.css" media="none" onload="if(media!='all')media='all'">




    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
    <link rel="stylesheet" href="/css/post.css">




    
        <link rel="stylesheet" type="text/css" href="/css/reward.css">
    



    <script src="/libs/jquery/jquery-3.6.0.min.js"></script>

<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; }  .github-emoji > span { position: relative; z-index: 10; }  .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; }  .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>


<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/" class="waves-effect waves-light">
                    
                    <img src="/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">LowYeah</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
  <li>
    <a href="javascript:;" class="waves-effect waves-light" onclick="switchNightMode()" title="深色/浅色模式" >
      <i id="sum-moon-icon" class="fas fa-sun" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">LowYeah</div>
        <div class="logo-desc">
            
            Never really desperate, only the lost of the soul.
            
        </div>
    </div>

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="kamisatonobitta.github.io" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>Liu
            </a>
        </li>
        
    </ul>
</div>


        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="kamisatonobitta.github.io" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="Liu" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('/medias/featureimages/5.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">实训day_01</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/springboot/">
                                <span class="chip bg-color">springboot</span>
                            </a>
                        
                            <a href="/tags/java/">
                                <span class="chip bg-color">java</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/categories/springboot/" class="post-category">
                                springboot
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2023-02-23
                </div>
                

                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-check fa-fw"></i>更新日期:&nbsp;&nbsp;
                    2023-02-28
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    4k
                </div>
                

                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>
        </div>
        <hr class="clearfix">

        
        <!-- 是否加载使用自带的 prismjs. -->
        <link rel="stylesheet" href="/libs/prism/prism.min.css">
        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <h1 id="实训day-01笔记"><a href="#实训day-01笔记" class="headerlink" title="实训day_01笔记"></a>实训day_01笔记</h1><h2 id="项目名称"><a href="#项目名称" class="headerlink" title="项目名称"></a>项目名称</h2><pre class="line-numbers language-java" data-language="java"><code class="language-java">电音院购票系统<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>

<h2 id="开发工具和环境"><a href="#开发工具和环境" class="headerlink" title="开发工具和环境"></a>开发工具和环境</h2><pre class="line-numbers language-java" data-language="java"><code class="language-java"><span class="token function">idea</span><span class="token punctuation">(</span>企业主流的软件<span class="token punctuation">)</span> 		 <span class="token function">eclipse</span><span class="token punctuation">(</span>企业用的比较少了<span class="token punctuation">)</span>
mysql<span class="token operator">:</span><span class="token number">5.</span><span class="token function">5</span><span class="token punctuation">(</span>低版本<span class="token punctuation">)</span>			<span class="token number">8.</span><span class="token function">0</span><span class="token punctuation">(</span>高版本<span class="token punctuation">)</span>
jdk<span class="token operator">:</span> <span class="token number">1.</span><span class="token function">8</span><span class="token punctuation">(</span>企业主要使用的版本<span class="token punctuation">)</span> 
maven<span class="token operator">:</span>包管理的工具和仓库<span class="token punctuation">,</span>当我们没有使用maven的时候需要自己进行手动的导包处理<span class="token punctuation">,</span>现在如果使用maven就不需要手动导包了<span class="token punctuation">,</span>只需要将包的配置写在项目文件中<span class="token punctuation">,</span>可以自动的从网络上进行包的下载和使用<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>

<h2 id="技术栈"><a href="#技术栈" class="headerlink" title="技术栈"></a>技术栈</h2><pre class="line-numbers language-java" data-language="java"><code class="language-java">前端<span class="token operator">:</span>html5 css3 <span class="token function">js</span><span class="token punctuation">(</span>javascript<span class="token punctuation">)</span> <span class="token function">vue</span><span class="token punctuation">(</span>目前前端后端进行分离的时候使用的技术<span class="token punctuation">)</span> <span class="token function">axios</span><span class="token punctuation">(</span>前端向后端发送数据请求<span class="token punctuation">)</span>
后端<span class="token operator">:</span>
	springboot<span class="token operator">:</span>是目前我们主要使用的一个后端框架技术<span class="token punctuation">,</span>主要在于配置<span class="token punctuation">,</span>能够快速搭建项目<span class="token punctuation">,</span>并且能够让项目之间的数据传输更加简单<span class="token punctuation">,</span>快捷 
    mybatis<span class="token operator">:</span>其实就是之前我们使用java和数据库进行连接的时候使用的jdbc的封装<span class="token punctuation">,</span>让我们在框架使用的时候对数据库的管理更加简单方便<span class="token punctuation">,</span>一般是以xml文件进行数据库语言的编程<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>

<h2 id="项目过程"><a href="#项目过程" class="headerlink" title="项目过程"></a>项目过程</h2><pre class="line-numbers language-java" data-language="java"><code class="language-java"><span class="token number">1</span>、项目功能分析
	分析整个项目有多少功能<span class="token punctuation">,</span>我们要实现哪些<span class="token punctuation">,</span>然后根据项目的功能开始处理数据库一共有几张表<span class="token punctuation">,</span>有哪些字段
<span class="token number">2</span>、创建数据库表
<span class="token number">3</span>、开始写后端代码<span class="token punctuation">,</span>开始创建数据持久层
<span class="token number">4</span>、开始进行数据库语句的分析以及使用jdbc进行数据库与java代码之间的连接处理
<span class="token number">5</span>、要进行数据逻辑的判断
<span class="token number">6</span>、进行前端和后端之间的连接处理<span class="token punctuation">(</span>数据请求<span class="token punctuation">)</span>
<span class="token number">7</span>、前端的处理<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<h2 id="javaweb项目和我们的框架项目之间的区别"><a href="#javaweb项目和我们的框架项目之间的区别" class="headerlink" title="javaweb项目和我们的框架项目之间的区别"></a>javaweb项目和我们的框架项目之间的区别</h2><pre class="line-numbers language-java" data-language="java"><code class="language-java">项目功能<span class="token operator">:</span>
javaweb项目需要我们自己手动去进行各种逻辑设置<span class="token punctuation">,</span>以及工具处理<span class="token punctuation">,</span>还有就是对象创建
框架项目<span class="token punctuation">,</span>主要在于对各种对象和类之间的设置<span class="token punctuation">,</span>逻辑处理会更加简单
项目的结构<span class="token operator">:</span>
javaweb<span class="token operator">:</span>
	pojo<span class="token operator">:</span>数据持久 
	dao<span class="token operator">:</span>数据库处理
	service<span class="token operator">:</span>逻辑处理
	servlet<span class="token operator">:</span>前后端之间的数据请求和连接
	utils<span class="token operator">:</span>分页工具<span class="token punctuation">,</span>jdbc连接工具<span class="token punctuation">,</span>数据库连接池<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
	前端<span class="token operator">:</span>h5页面
框架项目<span class="token operator">:</span>
	pojo<span class="token operator">:</span>数据持久 
	dao<span class="token operator">:</span>数据库处理使用mybatis框架<span class="token punctuation">,</span>不需要我们再去使用jdbc的工具进行处理了
	service<span class="token operator">:</span>逻辑处理
	controller<span class="token operator">:</span>前后端之间的数据请求和连接
	前端<span class="token operator">:</span>h5页面<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h2 id="项目数据库表的配置"><a href="#项目数据库表的配置" class="headerlink" title="项目数据库表的配置"></a>项目数据库表的配置</h2><pre class="line-numbers language-mysql" data-language="mysql"><code class="language-mysql">1、分析系统中有哪些表?表的个数?
    用户表 tb_user  
    	id(int) username(varchar(20)) password(varchar(20)) truename(varchar(20)) 	usersex(varchar(2))  usertel(varchar(20)) status(int 默认为0)
    管理员表 tb_admin
    	id(int) name(varchar(20)) pwd(varchar(20)) tel(varchar(11)) status(int)
    影厅表 tb_hall
    	id(int) name(varchar(20)) seats(LongText) status(int)
    电影信息表 tb_movie
    	id(int) name(varchar(50)) 实训day-01(varchar(255)) description(LongText) director(varchar(20)) writer(varchar(20)) actor(varchar(20)) type(varchar(20)) area(varchar(20)) language(varchar(20)) showtime(Timestamp:时间戳) length(varcahr(20))
grade(double) status(int)
    电影排片表 tb_plan
    	id(int) playtime(Timestamp) price(decimal(10,2):小数类型一个10位,保留到小数点后两位)
    	seats(LongText) status(int) hall_id(int) movie_id(int)
    	创建外键
    订单信息表 tb_order
    	id(varchar(100)) status(int) price(decimal(10,2)) user_id(谁买的) plan_id(买了哪个排片)
2、分析系统中表与表之间的关系? 1:1 1:n n:n
	电影表n 影厅表n 	中间表:排片表(tb_plan)
    用户表n 排片表n   中间表:订单表(tb_order)
3、分析每一个表中的字段信息?
    显性字段	隐性字段(业务字段)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<h2 id="新建数据库"><a href="#新建数据库" class="headerlink" title="新建数据库"></a>新建数据库</h2><pre class="line-numbers language-mysql" data-language="mysql"><code class="language-mysql">utf8:每个字段占三个字节
utf8mb4:每个字段占四个字节
虽然都能够处理中文,但是utf8因为空间比较小可能会出现乱码的情况,但是utf8mb4能够完全存储中

-- 管理员信息表 tb_admin
CREATE TABLE tb_admin(
	id INT PRIMARY KEY auto_increment, -- id
	name varchar(20) UNIQUE not null, -- 名字
	pwd varchar(20) not NULL, -- 密码
	tel varchar(20) not null, -- 电话
	status int not null DEFAULT 0 -- 状态
);

INSERT into tb_admin(name,pwd,tel)
VALUES('zhangsan','123456','13233334455');

-- 影厅信息表
CREATE TABLE tb_hall(
	id int PRIMARY KEY auto_increment, -- id
	name varchar(20) UNIQUE not null, -- 名字
	seats LONGTEXT not null, -- 座位以数组的形式进行表示
	status int DEFAULT 0 -- 状态
)


-- 电影信息表
CREATE TABLE tb_movie(
	id int PRIMARY KEY auto_increment, -- 编号
	name varchar(50) not NULL, -- 名字
	实训day-01 varchar(255) not null, -- 存储图片的位置
	description LONGTEXT, -- 描述
	director varchar(20) not NULL,-- 导演
	writer varchar(20) not null, -- 编剧
	actor varchar(200) not null, -- 主演
	type varchar(50) not null, -- 类型
	area varchar(20) not null, -- 制片国家/地区
	language varchar(20) not null, -- 语言
	showtime TIMESTAMP, -- 上映时间
	length varchar(20), -- 片长
	grade DOUBLE, -- 评分
	status int DEFAULT 0, -- 状态
	link text -- 连接地址
)

-- 电影排片表
CREATE TABLE tb_plan(
	id int PRIMARY KEY auto_increment, -- id
	playtime TIMESTAMP not null, -- 播放时间
	price DECIMAL(10,2) not null, -- 票价
	seats LONGTEXT, -- 作为
	status int DEFAULT 0, -- 状态
	hall_id int not NULL, -- 外键连接影厅编号
	movie_id int not null, -- 外键连接电影编号
	CONSTRAINT fk_plan_hall FOREIGN KEY (hall_id) REFERENCES tb_hall(id),
	CONSTRAINT fk_plan_movie FOREIGN KEY (movie_id) REFERENCES tb_movie(id)
)

-- 用户表
CREATE TABLE tb_user(
	id int PRIMARY KEY auto_increment, -- 编号
	username VARCHAR(20) not NULL, -- 昵称
	password VARCHAR(20) not null, -- 密码
	truename varchar(20) not null, -- 真实名字
	usersex varchar(20) not null, -- 性别
	usertel varchar(20), -- 电话
	userstatus int DEFAULT 0 -- 状态
)

-- 订单表
CREATE TABLE tb_order(
	id VARCHAR(100) PRIMARY KEY, -- 编号
	status int DEFAULT 0, -- 状态
	price DECIMAL(10,2) not null, -- 价格
	user_id int not null, -- 用户id
	plan_id int not null, -- 排片id
	CONSTRAINT fk_order_user FOREIGN KEY (user_id) REFERENCES tb_user(id),
	CONSTRAINT fk_order_plan FOREIGN KEY (plan_id) REFERENCES tb_plan(id),
	seat varchar(100) not null
)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<h2 id="什么是springboot？"><a href="#什么是springboot？" class="headerlink" title="什么是springboot？"></a>什么是springboot？</h2><pre class="line-numbers language-java" data-language="java"><code class="language-java">之前的项目<span class="token operator">:</span>jsp <span class="token operator">+</span> servlet <span class="token operator">+</span> jdbc <span class="token operator">+</span> db
ssm项目<span class="token operator">:</span>html <span class="token operator">+</span> springMVC <span class="token operator">+</span> mybatis <span class="token operator">+</span> db
springboot项目<span class="token operator">:</span>html <span class="token operator">+</span> springMVC <span class="token operator">+</span> springboot <span class="token operator">+</span> mybatis <span class="token operator">+</span> db
mvc设计模式<span class="token operator">:</span>
	模型层<span class="token operator">:</span>pojo dao service	
	视图层<span class="token operator">:</span>html
	控制层<span class="token operator">:</span>springMVC
没有使用springboot之前<span class="token punctuation">,</span>我们使用的是<span class="token function">ssm</span><span class="token punctuation">(</span>spring <span class="token operator">+</span> springmvc <span class="token operator">+</span> mybatis<span class="token punctuation">)</span>
创建项目的时候会有很多的配置文件<span class="token punctuation">,</span>需要有很多自己的配置<span class="token punctuation">,</span>包括服务器<span class="token punctuation">(</span>tomcat<span class="token punctuation">)</span>也需要自己配置<span class="token punctuation">,</span>maven也需要
	步骤<span class="token number">1</span><span class="token operator">:</span>配置web<span class="token punctuation">.</span>xml<span class="token punctuation">,</span>加载spring框架<span class="token punctuation">,</span>加载springMVC框架
	步骤<span class="token number">2</span><span class="token operator">:</span>配置数据库连接<span class="token punctuation">,</span>再配置spring事务管理器
	步骤<span class="token number">3</span><span class="token operator">:</span>加载配置文件<span class="token punctuation">,</span>开启注解
	步骤<span class="token number">4</span><span class="token operator">:</span>配置日志文件
	<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
    最后配置服务器并且进行调试
现在流行springboot使用了特定的方式进行配置<span class="token punctuation">,</span>开发人员不需要手动加载很多配置<span class="token punctuation">,</span>可以快速搭建项目<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<h2 id="新建springboot项目"><a href="#新建springboot项目" class="headerlink" title="新建springboot项目"></a>新建springboot项目</h2><p>1、找到File —&gt; new —&gt; project</p>
<p>2、选择项目模式</p>
<p><img src="/2023/022356527/1%E3%80%81%E9%80%89%E6%8B%A9%E9%A1%B9%E7%9B%AE%E6%A8%A1%E5%BC%8F.png" alt="1、选择项目模式"></p>
<p>3、配置项目</p>
<p><img src="/2023/022356527/2%E3%80%81%E9%85%8D%E7%BD%AE%E9%A1%B9%E7%9B%AE.png" alt="2、配置项目"></p>
<p>4、配置项目依赖</p>
<p><img src="/2023/022356527/3%E3%80%81%E9%85%8D%E7%BD%AE%E9%A1%B9%E7%9B%AE%E4%BE%9D%E8%B5%96.png" alt="3、配置项目依赖"></p>
<p>5、项目存储地址</p>
<p><img src="/2023/022356527/4%E3%80%81%E9%A1%B9%E7%9B%AE%E5%AD%98%E5%82%A8%E5%9C%B0%E5%9D%80.png" alt="4、项目存储地址"></p>
<p>6、项目结构</p>
<p><img src="/2023/022356527/5%E3%80%81%E9%A1%B9%E7%9B%AE%E7%9B%AE%E5%BD%95.png" alt="5、项目目录"></p>
<h2 id="如果出现jdk版本不对的情况应该怎么办"><a href="#如果出现jdk版本不对的情况应该怎么办" class="headerlink" title="如果出现jdk版本不对的情况应该怎么办?"></a>如果出现jdk版本不对的情况应该怎么办?</h2><p>1、找到pom.xml文件,查看是否是你当前的jdk版本</p>
<pre class="line-numbers language-java" data-language="java"><code class="language-java"><span class="token generics"><span class="token punctuation">&lt;</span>properties<span class="token punctuation">&gt;</span></span>
        <span class="token generics"><span class="token punctuation">&lt;</span>java<span class="token punctuation">.</span>version<span class="token punctuation">&gt;</span></span><span class="token number">1.8</span><span class="token operator">&lt;</span><span class="token operator">/</span>java<span class="token punctuation">.</span>version<span class="token operator">&gt;</span> <span class="token operator">--</span> 就是要填写你的jdk版本的地方
<span class="token operator">&lt;</span><span class="token operator">/</span>properties<span class="token operator">&gt;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>

<p>2、使用快捷键: shift + ctrl + alt + s，其实你可以在工具左上角File中 Project Structure</p>
<p>​      找到所有需要设置jdk版本的位置将jdk版本进行配置</p>
<h2 id="关于maven环境的配置"><a href="#关于maven环境的配置" class="headerlink" title="关于maven环境的配置"></a>关于maven环境的配置</h2><p>1、下载maven</p>
<p>​	已经共享在钉钉的群文件里面了,去找到文件夹apache-maven-3.5.4,然后将其存储在本地磁盘中</p>
<p>2、找到配置maven的环境</p>
<p>​	(1)在”此电脑”,右键找到”属性”,在窗口中找到”高级系统设置”</p>
<p><img src="/2023/022356527/6%E3%80%81%E6%89%BE%E5%88%B0%E9%AB%98%E7%BA%A7%E7%B3%BB%E7%BB%9F%E8%AE%BE%E7%BD%AE.png" alt="6、找到高级系统设置"></p>
<p>​	(2)找到环境变量在系统变量中点击”新建”</p>
<p><img src="/2023/022356527/7%E3%80%81%E8%AE%BE%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F.png" alt="7、设置环境变量"></p>
<p><img src="/2023/022356527/8%E3%80%81%E7%BC%96%E8%BE%91%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8F.png" alt="8、编辑系统变量"></p>
<p>​	(3)在path中将我们新建的MAVEN_HOME,引入进来</p>
<p><img src="/2023/022356527/9%E3%80%81path%E8%B7%AF%E5%BE%84%E4%B8%AD%E8%AE%BE%E7%BD%AE%E5%8F%98%E9%87%8F%E7%BB%91%E5%AE%9A%E5%9C%A8%E4%B8%80%E8%B5%B7.png" alt="9、path路径中设置变量绑定在一起"></p>
<p>maven的原理</p>
<p><img src="/2023/022356527/10%E3%80%81maven%E7%9A%84%E5%8E%9F%E7%90%86.png" alt="10、maven的原理"></p>
<p>如何修改本地仓库的位置</p>
<p><img src="/2023/022356527/11%E3%80%81%E4%BF%AE%E6%94%B9maven%E7%9A%84%E9%85%8D%E7%BD%AE.png" alt="11、修改maven的配置"></p>
<p>在idea中如何配置自己的本地仓库</p>
<p><img src="/2023/022356527/12%E3%80%81idea%E4%B8%AD%E5%A6%82%E4%BD%95%E8%AE%BE%E7%BD%AE%E6%9C%AC%E6%9C%BA%E7%9A%84maven.png" alt="12、idea中如何设置本机的maven"></p>
<h2 id="如果出现maven报错该怎么办"><a href="#如果出现maven报错该怎么办" class="headerlink" title="如果出现maven报错该怎么办?"></a>如果出现maven报错该怎么办?</h2><p>1、找到你maven安装在什么位置</p>
<p>File —&gt; settings —&gt; 输入maven —&gt; 查看位置</p>
<p><img src="/2023/022356527/12%E3%80%81idea%E4%B8%AD%E5%A6%82%E4%BD%95%E8%AE%BE%E7%BD%AE%E6%9C%AC%E6%9C%BA%E7%9A%84maven.png" alt="12、idea中如何设置本机的maven"></p>
<p>2、找到你磁盘中maven的位置</p>
<p><img src="/2023/022356527/14%E3%80%81%E6%89%BE%E5%88%B0maven%E7%9A%84%E4%BD%8D%E7%BD%AE%E6%89%BE%E5%88%B0settings%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6.png" alt="14、找到maven的位置找到settings的配置文件"></p>
<p>3、查看settings文件中本地库的位置并且查看是否是默认地址</p>
<p><img src="/2023/022356527/15%E3%80%81%E6%89%BE%E5%88%B0%E6%9C%AC%E5%9C%B0%E4%BB%93%E5%BA%93%E5%9C%A8%E4%BB%80%E4%B9%88%E5%9C%B0%E6%96%B9.png" alt="15、找到本地仓库在什么地方"></p>
<p>4、找到本地仓库的位置然后将本地仓库中下载失败的包文件加删除掉</p>
<p><img src="/2023/022356527/16%E3%80%81%E6%89%BE%E5%88%B0%E5%8C%85%E7%9A%84%E4%BD%8D%E7%BD%AE.png" alt="16、找到包的位置"></p>
<p>5、刷新重新下载</p>
<p><img src="/2023/022356527/17%E3%80%81%E7%82%B9%E5%87%BB%E9%87%8D%E6%96%B0%E4%B8%8B%E8%BD%BD%E5%8C%85.png" alt="17、点击重新下载包"></p>
<h2 id="什么是mybatis？"><a href="#什么是mybatis？" class="headerlink" title="什么是mybatis？"></a>什么是mybatis？</h2><pre class="line-numbers language-java" data-language="java"><code class="language-java">使用jdbc访问数据库<span class="token punctuation">,</span>除了自己写sql语句之外<span class="token punctuation">,</span>还需要操作<span class="token operator">:</span><span class="token class-name">Connection</span>、<span class="token class-name">Statement</span>、<span class="token class-name">PreparedStatement</span>、<span class="token class-name">ResultSet</span><span class="token punctuation">,</span>我们需要写很多的代码
原生的jdbc代码<span class="token operator">:</span>
	<span class="token number">1</span>、加载驱动
	<span class="token number">2</span>、获取连接对象
	<span class="token number">3</span>、编写sql语句
	<span class="token number">4</span>、获取预处理对象<span class="token class-name">PreparedStatement</span>
	<span class="token number">5</span>、给sql语句中的问号进行赋值<span class="token punctuation">(</span>防止sql注入<span class="token punctuation">)</span><span class="token punctuation">,</span>ps<span class="token punctuation">.</span><span class="token function">setXXX</span><span class="token punctuation">(</span>问号的位置<span class="token punctuation">,</span>值<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token number">6</span>、执行sql语句<span class="token punctuation">(</span>插入<span class="token punctuation">,</span>修改<span class="token punctuation">,</span>删除<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span>
    <span class="token number">7</span>、处理结果集
    <span class="token number">8</span>、释放资源
使用mybatis<span class="token punctuation">,</span>只需要会写sql语句<span class="token punctuation">,</span>其他的工作都交给框架来完成了<span class="token punctuation">,</span>比如<span class="token operator">:</span><span class="token class-name">Connection</span><span class="token punctuation">,</span>执行sql语句<span class="token punctuation">,</span>重复性的工作都可以省略了<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<h2 id="插件的安装"><a href="#插件的安装" class="headerlink" title="插件的安装"></a>插件的安装</h2><p>找到File —&gt; settings —&gt; plugins</p>
<p><img src="/2023/022356527/13%E3%80%81%E6%8F%92%E4%BB%B6%E7%9A%84%E5%AE%89%E8%A3%85.png" alt="13、插件的安装"></p>
<h2 id="pom-xml文件的配置"><a href="#pom-xml文件的配置" class="headerlink" title="pom.xml文件的配置"></a>pom.xml文件的配置</h2><pre class="line-numbers language-markup" data-language="markup"><code class="language-markup"><span class="token prolog">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>project</span> <span class="token attr-name">xmlns</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>http://maven.apache.org/POM/4.0.0<span class="token punctuation">"</span></span> <span class="token attr-name"><span class="token namespace">xmlns:</span>xsi</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>http://www.w3.org/2001/XMLSchema-instance<span class="token punctuation">"</span></span>
         <span class="token attr-name"><span class="token namespace">xsi:</span>schemaLocation</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>modelVersion</span><span class="token punctuation">&gt;</span></span>4.0.0<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>modelVersion</span><span class="token punctuation">&gt;</span></span>

    <span class="token comment">&lt;!--设置当前项目的版本是什么--&gt;</span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>parent</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-boot-starter-parent<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
        <span class="token comment">&lt;!--如果你的idea版本是20及以上的可以使用3.0.0的版本,如果是以下的可以使用2.7.7和2.7.5的版本--&gt;</span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span>2.7.7<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>version</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>relativePath</span><span class="token punctuation">/&gt;</span></span> <span class="token comment">&lt;!-- lookup parent from repository --&gt;</span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>parent</span><span class="token punctuation">&gt;</span></span>

    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>com.softeem<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>movieproject<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span>0.0.1-SNAPSHOT<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>version</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>name</span><span class="token punctuation">&gt;</span></span>movieproject<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>name</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>description</span><span class="token punctuation">&gt;</span></span>Demo project for Spring Boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>description</span><span class="token punctuation">&gt;</span></span>
    <span class="token comment">&lt;!--设置jdk的版本号--&gt;</span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>properties</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>java.version</span><span class="token punctuation">&gt;</span></span>1.8<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>java.version</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>properties</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependencies</span><span class="token punctuation">&gt;</span></span>
        <span class="token comment">&lt;!--springboot中的springmvc的版本号--&gt;</span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-boot-starter-web<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
        <span class="token comment">&lt;!--设置springboot中的mybatis的版本号--&gt;</span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.mybatis.spring.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>mybatis-spring-boot-starter<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span>2.3.0<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>version</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>

        <span class="token comment">&lt;!--热部署工具的版本号--&gt;</span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-boot-devtools<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>scope</span><span class="token punctuation">&gt;</span></span>runtime<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>scope</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>optional</span><span class="token punctuation">&gt;</span></span>true<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>optional</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
        <span class="token comment">&lt;!--设置mysql的驱动的版本号--&gt;</span>
        <span class="token comment">&lt;!--如果你的mysql是5.X的版本,就使用5.x的包--&gt;</span>
        <span class="token comment">&lt;!--如果你的mysql是8.X的版本,就使用8.x的包--&gt;</span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>mysql<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>mysql-connector-java<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>scope</span><span class="token punctuation">&gt;</span></span>runtime<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>scope</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span>5.1.49<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>version</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
        <span class="token comment">&lt;!--设置持久层工具的包,小辣椒的lombok的包--&gt;</span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.projectlombok<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>lombok<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>optional</span><span class="token punctuation">&gt;</span></span>true<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>optional</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span>1.18.20<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>version</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
        <span class="token comment">&lt;!--springboot自带的单元测试的包--&gt;</span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-boot-starter-test<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>scope</span><span class="token punctuation">&gt;</span></span>test<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>scope</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
        <span class="token comment">&lt;!--添加阿里连接池的包--&gt;</span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>com.alibaba<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>druid<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span>1.2.4<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>version</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependencies</span><span class="token punctuation">&gt;</span></span>

    <span class="token comment">&lt;!--插件--&gt;</span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>build</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>plugins</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>plugin</span><span class="token punctuation">&gt;</span></span>
                <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
                <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-boot-maven-plugin<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
                <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>configuration</span><span class="token punctuation">&gt;</span></span>
                    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>excludes</span><span class="token punctuation">&gt;</span></span>
                        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>exclude</span><span class="token punctuation">&gt;</span></span>
                            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.projectlombok<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
                            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>lombok<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
                        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>exclude</span><span class="token punctuation">&gt;</span></span>
                    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>excludes</span><span class="token punctuation">&gt;</span></span>
                <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>configuration</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>plugin</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>plugins</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>build</span><span class="token punctuation">&gt;</span></span>

<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>project</span><span class="token punctuation">&gt;</span></span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>



<h2 id="阿里连接池"><a href="#阿里连接池" class="headerlink" title="阿里连接池"></a>阿里连接池</h2><pre class="line-numbers language-java" data-language="java"><code class="language-java">数据库连接池<span class="token operator">:</span>
	<span class="token constant">DBCP</span> <span class="token constant">C3P0</span> druid阿里连接池
因为我们在项目中需要每一个操作第一步都是进行数据库的连接<span class="token punctuation">,</span>想要将数据库和java代码连接在一起<span class="token punctuation">,</span>就需要数据库驱动和jdbc来帮我们创建连接。创建连接对象和释放连接对象需要花费很多的时间和内存空间<span class="token punctuation">,</span>这个时候我们就可以使用数据库连接池。数据库连接池在初始化的时候就创建了一部分的<span class="token class-name">Connection</span>对象<span class="token punctuation">,</span>当我们需要进行操作的时候<span class="token punctuation">,</span>直接从数据库连接池中获取对象<span class="token punctuation">,</span>使用完毕只有将连接放回到数据库连接池中。这样的话我们节省创建的时间<span class="token punctuation">,</span>关闭连接的时间以及大量的系统存消耗。项目的相应就会加速。能够提升用户的体验感。<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>

<h2 id="application-properties"><a href="#application-properties" class="headerlink" title="application.properties"></a>application.properties</h2><pre class="line-numbers language-markup" data-language="markup"><code class="language-markup">#http://localhost:9999/movie/
#http:网络请求头
#localhost:本机的服务器地址 你也可以写自己的ip地址
#9999:你设置的端口号
#movie:咱们在下面设置的项目名
#系统访问之后会默认去找到在resources下面的static下面的index页面

#应用名称
spring.application.name=movie

#tomcat服务器端口号
#因为springboot项目自带了服务器,所以我们不需要给其进行服务器的配置
#默认端口号是8080,但是8080容易发生冲突,我们可以给其设置别的端口号
server.port=9999

#访问上下文的配置
server.servlet.context-path=/movie

#添加编码格式的配置防止出现乱码
server.tomcat.uri-encoding=UTF-8

#数据库相关的配置
#如果你是用的是6.X以下的数据库,那么配置的时候使用的名称就是:com.mysql.jdbc.Driver
#如果你是用的是6.X以上的数据库,那么配置的时候使用的名称就是:com.mysql.cj.jdbc.Driver
#加载驱动
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#设置数据库连接的地址
spring.datasource.url=jdbc:mysql://localhost:3306/moviesystem?characterEncoding=UTF-8
#用户名
spring.datasource.username=root
#密码
spring.datasource.password=123456
#使用阿里连接池
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource

#如果我们使用了阿里巴巴的连接池就可以省略下面自己手动配置的连接
#最大连接数
#spring.datasource.max-idle=10
#最长等待时间
#spring.datasource.max-wait=10000
#最小闲置连接数
#spring.datasource.min-idle=5
#初始化连接数
#spring.datasource.initial-size=5<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<h2 id="什么是spring"><a href="#什么是spring" class="headerlink" title="什么是spring?"></a>什么是spring?</h2><pre class="line-numbers language-java" data-language="java"><code class="language-java"><span class="token number">1</span>、spring框架是一个java封装好内容之后<span class="token punctuation">,</span>能够进行项目快速搭建的框架<span class="token punctuation">,</span>底层已经写好了很多的操作，主要是<span class="token constant">IOC</span>和<span class="token constant">AOP</span>
<span class="token number">2</span>、springIOC <span class="token constant">DI</span>
	<span class="token constant">IOC</span>叫控制翻转，指的是将对象的创建交给spring容器进行处理<span class="token punctuation">,</span>我们不再需要处理类与类之间的关系<span class="token punctuation">,</span>也不需要创建对象了<span class="token punctuation">,</span>之前是我们自己<span class="token keyword">new</span>对象<span class="token punctuation">,</span>从使用了spring之后<span class="token punctuation">,</span>所有的对象创建交给框架来处理
<span class="token number">3</span>、<span class="token class-name">SpringAOP</span>
	面向切面编程<span class="token punctuation">,</span>将我们的代码进行模块化处理<span class="token punctuation">,</span>将功能一个个封装起来<span class="token punctuation">,</span>在哪个地方需要使用某一个功能就将其插入到已有的框架在<span class="token punctuation">,</span>然后将其一整个代码相当于进行了拼接处理。有动态代理<span class="token punctuation">,</span>jdk<span class="token punctuation">,</span>cglib<span class="token punctuation">,</span>还声明了对于事务的事务<span class="token punctuation">,</span>还有日志管理的处理<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<h2 id="SpringMVC框架"><a href="#SpringMVC框架" class="headerlink" title="SpringMVC框架"></a>SpringMVC框架</h2><pre class="line-numbers language-java" data-language="java"><code class="language-java"><span class="token number">1</span>、我们使用网址进行访问的时候<span class="token punctuation">,</span>资源就需要进行加载处理<span class="token punctuation">,</span>之前我们使用jsp的时候<span class="token punctuation">.</span>jsp底层也会以java的形式进行编辑处理<span class="token punctuation">,</span>但是现在我们使用的是html<span class="token punctuation">,</span>这个静态页面本身就可以直接在浏览器上执行<span class="token punctuation">,</span>所以<span class="token punctuation">,</span>我们想要知道其可不可以在服务器上进行访问<span class="token punctuation">,</span>需要根据我们本身项目的地址进行访问<span class="token punctuation">,</span>在整个项目中进行数据的获取<span class="token punctuation">,</span>如果只是执行一个html文件<span class="token punctuation">,</span>那么什么数据也拿不到。
<span class="token number">2</span>、当浏览器对页面进行访问的时候<span class="token punctuation">,</span>如果可以访问到<span class="token punctuation">,</span>就直接显示项目中网页的内容<span class="token punctuation">,</span>如果访问不到就会出现<span class="token number">404</span>的情况<span class="token punctuation">,</span><span class="token number">404</span>表示资源没有找到。那么一般是在页面进行加载的时候已经出现了错误<span class="token punctuation">,</span>静态资源根本没有加载出来<span class="token punctuation">,</span>另外一种情况是在页面进行跳转的时候地址不对。<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>




                
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/about" rel="external nofollow noreferrer">LowYeah</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://kamisatonobitta.github.io/2023/022356527.html">https://kamisatonobitta.github.io/2023/022356527.html</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="/about" target="_blank">LowYeah</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/tags/springboot/">
                                    <span class="chip bg-color">springboot</span>
                                </a>
                            
                                <a href="/tags/java/">
                                    <span class="chip bg-color">java</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>

            
        </div>
    </div>

    

    

    

    

    
        <style>

    .valine-card {
        margin: 1.5rem auto;
    }

    /*卡片式背景*/
    #vcomments .vcards .vcard {
        padding: 15px 20px 0 20px;
        border-radius: 10px;
        margin-bottom: 15px;
        box-shadow: 0 0 4px 1px rgba(0, 0, 0, .12);
        transition: all .3s
    }

    #vcomments .vcards .vcard:hover {
        box-shadow: 0 0 8px 3px rgba(0, 0, 0, .12)
    }

    #vcomments .vcards .vcard .vh .vcard {
        border: none;
        box-shadow: none;
    }

    /*鼠标放置头像旋转*/
    img.vimg {
        transition: all 1s /* 旋转时间为 1s */
    }

    img.vimg:hover {
        transform: rotate(360deg);
        -webkit-transform: rotate(360deg);
        -moz-transform: rotate(360deg);
        -o-transform: rotate(360deg);
        -ms-transform: rotate(360deg);
    }


    /*===========背景图输入判断=========*/
    #veditor:focus {
        background-position-y: 200px;
        transition: all 0.2s ease-in-out 0s;
    }

    /*==========修改评论框样式===========start====*/
    .v .vwrap {
        padding: 0 0 20px;
    }

    /*内容框高度*/
    .v .veditor {
        min-height: 7rem;
        resize: none;
    }

    /*==========修改评论框样式===========end======*/

    /*头部空白栏高度*/
    .valine-card .card-content {
        padding: 20px 20px 5px 20px;
    }

    /* valine 评论框增加背景图片 */
    #vcomments textarea {
        /*背景图贴边*/
        margin-top: -30px;
        box-sizing: border-box;
        background: url("https://cdn.jsdelivr.net/gh/drew233/cdn/20200409110727.webp") 100% 100% no-repeat;
    }

    #vcomments p {
        margin: 2px 2px 10px;
        font-size: 1.05rem;
        line-height: 1.78rem;
    }

    #vcomments blockquote p {
        text-indent: 0.2rem;
    }

    #vcomments a {
        padding: 0 2px;
        color: #4cbf30;
        font-weight: 500;
        text-decoration: none;
    }

    #vcomments img {
        max-width: 100%;
        height: auto;
        cursor: pointer;
    }

    #vcomments ol li {
        list-style-type: decimal;
    }

    #vcomments ol,
    ul {
        display: block;
        padding-left: 2em;
        word-spacing: 0.05rem;
    }

    #vcomments ul li,
    ol li {
        display: list-item;
        line-height: 1.8rem;
        font-size: 1rem;
    }

    #vcomments ul li {
        list-style-type: disc;
    }

    #vcomments ul ul li {
        list-style-type: circle;
    }

    #vcomments table, th, td {
        padding: 12px 13px;
        border: 1px solid #dfe2e5;
    }

    #vcomments table, th, td {
        border: 0;
    }

    table tr:nth-child(2n), thead {
        background-color: #fafafa;
    }

    #vcomments table th {
        background-color: #f2f2f2;
        min-width: 80px;
    }

    #vcomments table td {
        min-width: 80px;
    }

    #vcomments h1 {
        font-size: 1.85rem;
        font-weight: bold;
        line-height: 2.2rem;
    }

    #vcomments h2 {
        font-size: 1.65rem;
        font-weight: bold;
        line-height: 1.9rem;
    }

    #vcomments h3 {
        font-size: 1.45rem;
        font-weight: bold;
        line-height: 1.7rem;
    }

    #vcomments h4 {
        font-size: 1.25rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    #vcomments h5 {
        font-size: 1.1rem;
        font-weight: bold;
        line-height: 1.4rem;
    }

    #vcomments h6 {
        font-size: 1rem;
        line-height: 1.3rem;
    }

    #vcomments p {
        font-size: 1rem;
        line-height: 1.5rem;
    }

    #vcomments hr {
        margin: 12px 0;
        border: 0;
        border-top: 1px solid #ccc;
    }

    #vcomments blockquote {
        margin: 15px 0;
        border-left: 5px solid #42b983;
        padding: 1rem 0.8rem 0.3rem 0.8rem;
        color: #666;
        background-color: rgba(66, 185, 131, .1);
    }

    #vcomments pre {
        font-family: monospace, monospace;
        padding: 1.2em;
        margin: .5em 0;
        background: #272822;
        overflow: auto;
        border-radius: 0.3em;
        tab-size: 4;
    }

    #vcomments code {
        font-family: monospace, monospace;
        padding: 1px 3px;
        font-size: 0.92rem;
        color: #e96900;
        background-color: #f8f8f8;
        border-radius: 2px;
    }

    #vcomments pre code {
        font-family: monospace, monospace;
        padding: 0;
        color: #e8eaf6;
        background-color: #272822;
    }

    #vcomments pre[class*="language-"] {
        padding: 1.2em;
        margin: .5em 0;
    }

    #vcomments code[class*="language-"],
    pre[class*="language-"] {
        color: #e8eaf6;
    }

    #vcomments [type="checkbox"]:not(:checked), [type="checkbox"]:checked {
        position: inherit;
        margin-left: -1.3rem;
        margin-right: 0.4rem;
        margin-top: -1px;
        vertical-align: middle;
        left: unset;
        visibility: visible;
    }

    #vcomments b,
    strong {
        font-weight: bold;
    }

    #vcomments dfn {
        font-style: italic;
    }

    #vcomments small {
        font-size: 85%;
    }

    #vcomments cite {
        font-style: normal;
    }

    #vcomments mark {
        background-color: #fcf8e3;
        padding: .2em;
    }

    #vcomments table, th, td {
        padding: 12px 13px;
        border: 1px solid #dfe2e5;
    }

    table tr:nth-child(2n), thead {
        background-color: #fafafa;
    }

    #vcomments table th {
        background-color: #f2f2f2;
        min-width: 80px;
    }

    #vcomments table td {
        min-width: 80px;
    }

    #vcomments [type="checkbox"]:not(:checked), [type="checkbox"]:checked {
        position: inherit;
        margin-left: -1.3rem;
        margin-right: 0.4rem;
        margin-top: -1px;
        vertical-align: middle;
        left: unset;
        visibility: visible;
    }
</style>

<div class="card valine-card" data-aos="fade-up">
    <div class="comment_headling" style="font-size: 20px; font-weight: 700; position: relative; padding-left: 20px; top: 15px; padding-bottom: 5px;">
        <i class="fas fa-comments fa-fw" aria-hidden="true"></i>
        <span>评论</span>
    </div>
    <div id="vcomments" class="card-content" style="display: grid">
    </div>
</div>

<script src="/libs/valine/av-min.js"></script>
<script src="/libs/valine/Valine.min.js"></script>
<script>
    new Valine({
        el: '#vcomments',
        appId: '74adcOVwtL1WrCSIrXIBmrWj-gzGzoHsz',
        appKey: 'JAUWmzE5PIXb2qhbs21BQFCT',
        tagMeta: ["博主","小伙伴","访客"],
        master: '224b25ba7c2dcacb7f81cf6b5adc1ebd',
        enableQQ: 'true' === 'true',
        notify: 'false' === 'true',
        verify: 'false' === 'true',
        visitor: 'true' === 'true',
        avatar: 'mm',
        pageSize: '10',
        lang: 'zh-cn',
        placeholder: '昵称填写qq可以显示qq头像和昵称哦~',
        emojiCDN: '//i0.hdslb.com/bfs/emote/',  
        // 表情title和图片映射
        emojiMaps: {
        "tv_doge": "6ea59c827c414b4a2955fe79e0f6fd3dcd515e24.png",
        "tv_亲亲": "a8111ad55953ef5e3be3327ef94eb4a39d535d06.png",
        "tv_偷笑": "bb690d4107620f1c15cff29509db529a73aee261.png",
        "tv_再见": "180129b8ea851044ce71caf55cc8ce44bd4a4fc8.png",
        "tv_冷漠": "b9cbc755c2b3ee43be07ca13de84e5b699a3f101.png",
        "tv_发怒": "34ba3cd204d5b05fec70ce08fa9fa0dd612409ff.png",
        "tv_发财": "34db290afd2963723c6eb3c4560667db7253a21a.png",
        "tv_可爱": "9e55fd9b500ac4b96613539f1ce2f9499e314ed9.png",
        "tv_吐血": "09dd16a7aa59b77baa1155d47484409624470c77.png",
        "tv_呆": "fe1179ebaa191569b0d31cecafe7a2cd1c951c9d.png",
        "tv_呕吐": "9f996894a39e282ccf5e66856af49483f81870f3.png",
        "tv_困": "241ee304e44c0af029adceb294399391e4737ef2.png",
        "tv_坏笑": "1f0b87f731a671079842116e0991c91c2c88645a.png",
        "tv_大佬": "093c1e2c490161aca397afc45573c877cdead616.png",
        "tv_大哭": "23269aeb35f99daee28dda129676f6e9ea87934f.png",
        "tv_委屈": "d04dba7b5465779e9755d2ab6f0a897b9b33bb77.png",
        "tv_害羞": "a37683fb5642fa3ddfc7f4e5525fd13e42a2bdb1.png",
        "tv_尴尬": "7cfa62dafc59798a3d3fb262d421eeeff166cfa4.png",
        "tv_微笑": "70dc5c7b56f93eb61bddba11e28fb1d18fddcd4c.png",
        "tv_思考": "90cf159733e558137ed20aa04d09964436f618a1.png",
        "tv_惊吓": "0d15c7e2ee58e935adc6a7193ee042388adc22af.png",
        "tv_打脸": "56ab10b624063e966bfcb76ea5dc4794d87dfd47.png",
        "tv_抓狂": "fe31c08edad661d63762b04e17b8d5ae3c71a757.png",
        "tv_抠鼻": "c666f55e88d471e51bbd9fab9bb308110824a6eb.png",
        "tv_斜眼笑": "911f987aa8bc1bee12d52aafe62bc41ef4474e6c.png",
        "tv_无奈": "ea8ed89ee9878f2fece2dda0ea8a5dbfe21b5751.png",
        "tv_晕": "5443c22b4d07fb1907ccc610c8e6db254f2461b7.png",
        "tv_流汗": "cead1c351ab8d79e9f369605beb90148db0fbed3.png",
        "tv_流泪": "7e71cde7858f0cd50d74b0264aa26db612a8a167.png",
        "tv_流鼻血": "c32d39db2737f89b904ca32700d140a9241b0767.png",
        "tv_点赞": "f85c354995bd99e28fc76c869bfe42ba6438eff4.png",
        "tv_生气": "26702dcafdab5e8225b43ffd23c94ac1ff932654.png",
        "tv_生病": "8b0ec90e6b86771092a498c54f09fc94621c1900.png",
        "tv_疑问": "0793d949b18d7be716078349c202c15ff166f314.png",
        "tv_白眼": "c1d59f439e379ee50eef488bcb5e5378e5044ea4.png",
        "tv_皱眉": "72ccad6679fea0d14cce648b4d818e09b8ffea2d.png",
        "tv_目瞪口呆": "0b8cb81a68de5d5365212c99375e7ace3e7891b7.png",
        "tv_睡着": "8b196675b53af58264f383c50ad0945048290b33.png",
        "tv_笑哭": "1abc628f6d4f4caf9d0e7800878f4697abbc8273.png",
        "tv_腼腆": "89712c0d4af73e67f89e35cbc518420380a7f6f4.png",
        "tv_色": "61822c7e9aae5da76475e7892534545336b23a6f.png",
        "tv_调侃": "4bc022533ef31544ca0d72c12c808cf4a1cce3e3.png",
        "tv_调皮": "b9c41de8e82dd7a8515ae5e3cb63e898bf245186.png",
        "tv_鄙视": "6e72339f346a692a495b123174b49e4e8e781303.png",
        "tv_闭嘴": "c9e990da7f6e93975e25fd8b70e2e290aa4086ef.png",
        "tv_难过": "87f46748d3f142ebc6586ff58860d0e2fc8263ba.png",
        "tv_馋": "fc7e829b845c43c623c8b490ee3602b7f0e76a31.png",
        "tv_鬼脸": "0ffbbddf8a94d124ca2f54b360bbc04feb6bbfea.png",
        "tv_黑人问号": "45821a01f51bc867da9edbaa2e070410819a95b2.png",
        "tv_鼓掌": "1d21793f96ef4e6f48b23e53e3b9e42da833a0f6.png"
        },
        requiredFields: ['nick','mail'], //设置必填项
    });
	// 自定义邮箱审核规则
    document.body.addEventListener('click', function (e) {
        if (e.target.classList.contains('vsubmit')) {
            const email = document.querySelector('input[type=email]');
            const nick = document.querySelector('input[name=nick]');
            const reg = /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
            if (!email.value || !nick.value || !reg.test(email.value)) {
                const str = `<div class="valert text-center"><div class="vtext">请填写正确的昵称和邮箱！</div></div>`;
                const vmark = document.querySelector('.vmark');
                vmark.innerHTML = str;
                vmark.style.display = 'block';
                setTimeout(function () {
                    vmark.style.display = 'none';
                    vmark.innerHTML = '';
                }, 2500);
            }
        }
    })
</script>

<!--酷Q推送-->


    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/2023/022335827.html">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/0.jpg" class="responsive-img" alt="springboot拦截器的使用">
                        
                        <span class="card-title">springboot拦截器的使用</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            springboot拦截器的使用
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2023-02-23
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/springboot/" class="post-category">
                                    springboot
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/springboot/">
                        <span class="chip bg-color">springboot</span>
                    </a>
                    
                    <a href="/tags/%E6%8B%A6%E6%88%AA%E5%99%A8/">
                        <span class="chip bg-color">拦截器</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                本篇&nbsp;<i class="far fa-dot-circle"></i>
            </div>
            <div class="card">
                <a href="/2023/022356527.html">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/5.jpg" class="responsive-img" alt="实训day_01">
                        
                        <span class="card-title">实训day_01</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            实训day_01
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2023-02-23
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/springboot/" class="post-category">
                                    springboot
                                </a>
                            
                            
                        </span>
                    </div>
                </div>

                
                <div class="card-action article-tags">
                    
                    <a href="/tags/springboot/">
                        <span class="chip bg-color">springboot</span>
                    </a>
                    
                    <a href="/tags/java/">
                        <span class="chip bg-color">java</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>


<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>


<!-- 代码块折行 -->

<style type="text/css">
code[class*="language-"], pre[class*="language-"] { white-space: pre !important; }
</style>


<script>
    $('#articleContent').on('copy', function (e) {
        // IE8 or earlier browser is 'undefined'
        if (typeof window.getSelection === 'undefined') return;

        var selection = window.getSelection();
        // if the selection is short let's not annoy our users.
        if (('' + selection).length < Number.parseInt('120')) {
            return;
        }

        // create a div outside of the visible area and fill it with the selected text.
        var bodyElement = document.getElementsByTagName('body')[0];
        var newdiv = document.createElement('div');
        newdiv.style.position = 'absolute';
        newdiv.style.left = '-99999px';
        bodyElement.appendChild(newdiv);
        newdiv.appendChild(selection.getRangeAt(0).cloneContents());

        // we need a <pre> tag workaround.
        // otherwise the text inside "pre" loses all the line breaks!
        if (selection.getRangeAt(0).commonAncestorContainer.nodeName === 'PRE' || selection.getRangeAt(0).commonAncestorContainer.nodeName === 'CODE') {
            newdiv.innerHTML = "<pre>" + newdiv.innerHTML + "</pre>";
        }

        var url = document.location.href;
        newdiv.innerHTML += '<br />'
            + '来源: LowYeah<br />'
            + '文章作者: LowYeah<br />'
            + '文章链接: <a href="' + url + '">' + url + '</a><br />'
            + '本文章著作权归作者所有，任何形式的转载都请注明出处。';

        selection.selectAllChildren(newdiv);
        window.setTimeout(function () {bodyElement.removeChild(newdiv);}, 200);
    });
</script>


<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>


  <!-- 是否加载使用自带的 prismjs. -->
  <script type="text/javascript" src="/libs/prism/prism.min.js"></script>


<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>



    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




    <footer class="page-footer bg-color">
    

    <div class="container row center-align"
         style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2023-2024</span>
            
            <a href="/about" target="_blank">LowYeah</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            
            <br>
            
            
            
                
            
            
                <span id="busuanzi_container_site_pv">
                &nbsp;|&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;
                    <span id="busuanzi_value_site_pv" class="white-color"></span>
            </span>
            
            
                <span id="busuanzi_container_site_uv">
                &nbsp;|&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;
                    <span id="busuanzi_value_site_uv" class="white-color"></span>
            </span>
            
            <br>

            <!-- 运行天数提醒. -->
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/KamisatoNobitta/KamisatoNobitta.github.io.git" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:2531145352@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=2531145352" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 2531145352" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







    <a href="/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/search.xml', 'searchInput', 'searchResult');
});
</script>

    <!-- 白天和黑夜主题 -->
<div class="stars-con">
    <div id="stars"></div>
    <div id="stars2"></div>
    <div id="stars3"></div>  
</div>

<script>
    function switchNightMode() {
        $('<div class="Cuteen_DarkSky"><div class="Cuteen_DarkPlanet"></div></div>').appendTo($('body')),
        setTimeout(function () {
            $('body').hasClass('DarkMode') 
            ? ($('body').removeClass('DarkMode'), localStorage.setItem('isDark', '0'), $('#sum-moon-icon').removeClass("fa-sun").addClass('fa-moon')) 
            : ($('body').addClass('DarkMode'), localStorage.setItem('isDark', '1'), $('#sum-moon-icon').addClass("fa-sun").removeClass('fa-moon')),
            
            setTimeout(function () {
            $('.Cuteen_DarkSky').fadeOut(1e3, function () {
                $(this).remove()
            })
            }, 2e3)
        })
    }
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    

    
    
    

    <!-- 雪花特效 -->
    

    <!-- 鼠标星星特效 -->
     
        <script type="text/javascript">
            // 只在桌面版网页启用特效
            var windowWidth = $(window).width();
            if (windowWidth > 768) {
                document.write('<script type="text/javascript" src="/libs/others/star.js"><\/script>');
            }
        </script>
    

    

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    <!--腾讯兔小巢-->
    
    

    

    

    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
